<template>
  <div>
    <el-row>
      <el-col :span="20" :offset="2">
        <div class="dw-user-body">
          <el-row>
            <el-col :span="4" style="height: 600px;">
              <self-menu></self-menu>
            </el-col>
            <el-col :span="20">
              <div style="padding: 30px;">
                <el-descriptions title="账号信息" column="1" border >
                  <el-descriptions-item label="账号">{{ userInfo.username }}</el-descriptions-item>
                  <el-descriptions-item label="绑定手机号">{{ userInfo.telnumber }}</el-descriptions-item>
                  <el-descriptions-item label="状态">
                    <el-tag
                      v-if="userInfo.status === 1"
                      type="danger" >冻结</el-tag>
                    <el-tag
                      v-else-if="userInfo.status === 0"
                      type="success" >可用</el-tag>
                    <el-tag v-else disable-transitions style="margin-left: 10px" >未知</el-tag>
                  </el-descriptions-item>
                  <el-descriptions-item label="创建时间">{{ userInfo.createdDate }}</el-descriptions-item>
                  <el-descriptions-item label="登录时间">{{ userInfo.lastLoginDate}}</el-descriptions-item>
                  <el-descriptions-item label="所属租户">{{ userInfo.belongTenement }}</el-descriptions-item>
                </el-descriptions>
              </div>
            </el-col>
          </el-row>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import SelfMenu from "./SelfMenu";
import {DateFormat} from "../../utils/common.js";
export default {
  name: "Selfaccount",
  components:{
    SelfMenu
  },
  data(){
    return{
      userInfo:{}
    }

  },
  created() {
    this.userInfo = JSON.parse(window.sessionStorage.getItem("data"))
    this.userInfo.createdDate = DateFormat(this.userInfo.createdDate)
    this.userInfo.lastLoginDate = DateFormat(this.userInfo.lastLoginDate)
  }
}
</script>

<style scoped>
.dw-user-body{
  background-color: white;
  min-height: 600px;
}
</style>
